package com.zhf.demo03.service;

import com.zhf.demo03.bean.User;
import com.zhf.demo03.dao.UserDao;
import com.zhf.demo03.factory.UserDaoFactory;

/**
 * @Author: ZhaoHuanfeng
 * @Date: 2020/10/15 23:35
 */
public class UserService {
    private UserDao userDao;

    //合成复用原则
    public UserService() {
        this.userDao = UserDaoFactory.getUserDao();
    }

    /**
     * 自定义成员方法实现登录功能
     * @param user
     * @return
     */
    public User userLoginService(User user){
        return userDao.userLogin(user);
    }
}
